package hot.job.core.job;

import org.quartz.InterruptableJob;
import org.quartz.UnableToInterruptJobException;

/**
 * jobs support stop immediately
 *
 * @author gaowenhao
 * @since 2022/7/4 20:52
 */
public abstract class StoppableJob implements InterruptableJob {

    private volatile Boolean stopped = false;

    @Override
    public void interrupt() throws UnableToInterruptJobException {
        this.stopped = true;
    }

    protected Boolean stopped(){
        return this.stopped;
    }

}
